﻿using MQ.Core.Common;
using MQ.Core.Entity.System;
using MQ.Core.IRepository.System;
using MQ.Core.IService.System;
using System;
using System.Collections.Generic;
using System.Text;

namespace MQ.Core.Service.System
{
    public class LogService : ILogService
    {
        private readonly ILogRepository logRepository;
        public LogService(ILogRepository logRepository)
        {
            this.logRepository = logRepository;
        }
        public void Delete(string ids)
        {
            logRepository.Delete(ids);
        }

        public void Delete(List<long> ids)
        {
            logRepository.Delete(ids);
        }

        public void Delete(long id)
        {
            logRepository.Delete(id);
        }

        public IEnumerable<LogEntity> GetList(string query)
        {
            return logRepository.GetList(query);
        }

        public IEnumerable<LogEntity> GetPageList(Pagination pagination, string query)
        {
            return logRepository.GetPageList(pagination, query);
        }

        public void Save(LogEntity entity)
        {
            if (entity.Id > 0) logRepository.Update(entity);
            else logRepository.Add(entity);
        }
    }
}
